#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct pii{
    int fi,se;
    bool operator <(const pii &_)const{
        if(fi != _.fi)return fi < _.fi;
        return se < _.se;
    }
};
inline int fr(int &x){
    char ch = getchar();x = 0;int f = 1;
    for(;!isdigit(ch);ch = getchar())if(ch == '-')f = -1;
    for(;isdigit(ch);ch = getchar())x = (x << 1) + (x << 3) + (ch ^ 48);
    return x *= f;
}
int n,r[100010];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    fr(n);
    for(int i = 1;i <= n;i++)fr(r[i]);
    sort(r + 1,r + n + 1);
    int lcnt = 0,ncnt = 0,ans = n;
    r[n + 1] = INT_MAX;
    for(int i = 1;i <= n + 1;i++){
        if(r[i] != r[i - 1]){
            ans -= min(lcnt,ncnt);
            lcnt = max(lcnt,ncnt);ncnt = 0;
        }
        ncnt++;
    }
    cout << ans;
    return 0;
}
